package com.ereport.entity;

import java.io.Serializable;
import java.sql.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "opportunity")
public class Opportunity implements Serializable{
	
	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")
	@Column(name="id")
	private int id;
	
	@ManyToOne
	@JoinColumn(name="exe_id")
	private Executives exeId;
	
	@Column(name="org_name")
	private String OrgName;
	
	@Column(name="division")
	private String division;
	
	@Column(name="name_of_user")
	private String contactName;
	
	@Column(name="enqiry_type")
	private String enqType;
	
	@Column(name="due_date")
	private Date dueDate;
	
	@Column(name="technical_bid")
	private Boolean techBid;
	
	@Column(name="price_bid")
	private Boolean priceBid;
	
	@Column(name="prj_name")
	private String projName;
	
	private int probability;
	
	@Column(name="opp_name")
	private String oppName;
	
	@Column(name="exec_name")
	private String exeName;
	
	@Column(name="quote_currency")
	private String currncy;
	
	@Column(name="curr_date")
	private Date currDate;
	
	@Column(name="enq_num")
	private String enqNum;
	@ManyToOne
	@JoinColumn(name="dact_id")
	private DailyActivity dactid;
	
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "enq_id", referencedColumnName = "id")
	private Set<OppParts> opParts = new HashSet<OppParts>();

	public Opportunity(){
		
	}
	public Opportunity(Executives ex,DailyActivity dactid, String org, String div, String user,
			String eqtype, Boolean tchBid, Boolean prcBid, java.sql.Date date,
			java.sql.Date date2, String projName,
			String executive, String quotCurr, String opprName,
			String ref) {
		this.exeId=ex;
		this.dactid=dactid;
		this.OrgName=org;
		this.division=div;
		this.contactName=user;
		this.enqType=eqtype;
		this.techBid=tchBid;
		this.priceBid=prcBid;
		this.dueDate=date;
		this.currDate=date2;
		
		this.projName=projName;
		this.exeName=executive;
		this.currncy=quotCurr;
		this.oppName=opprName;
		this.enqNum=ref;
	}

	public Opportunity(int id, Executives ex, DailyActivity da, String org,
			String div, String user, String eqtype, Boolean tchBid,
			Boolean prcBid, java.sql.Date date, java.sql.Date date2,
			String projName2, String executive, String quotCurr,
			String opprName, String ref) {
		this.id=id;
		this.exeId=ex;
		this.dactid=dactid;
		this.OrgName=org;
		this.division=div;
		this.contactName=user;
		this.enqType=eqtype;
		this.techBid=tchBid;
		this.priceBid=prcBid;
		this.dueDate=date;
		this.currDate=date2;
		this.projName=projName;
		this.exeName=executive;
		this.currncy=quotCurr;
		this.oppName=opprName;
		this.enqNum=ref;
		
	}
	public Set<OppParts> getOpParts() {
		return opParts;
	}

	public void setOpParts(Set<OppParts> opParts) {
		this.opParts = opParts;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Executives getExeId() {
		return exeId;
	}

	public void setExeId(Executives exeId) {
		this.exeId = exeId;
	}

	public String getOrgName() {
		return OrgName;
	}

	public void setOrgName(String orgName) {
		OrgName = orgName;
	}

	public String getDivision() {
		return division;
	}

	public void setDivision(String division) {
		this.division = division;
	}

	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}

	public String getEnqType() {
		return enqType;
	}

	public void setEnqType(String enqType) {
		this.enqType = enqType;
	}

	public Date getDueDate() {
		return dueDate;
	}

	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	public Boolean getTechBid() {
		return techBid;
	}

	public void setTechBid(Boolean techBid) {
		this.techBid = techBid;
	}

	public Boolean getPriceBid() {
		return priceBid;
	}

	public void setPriceBid(Boolean priceBid) {
		this.priceBid = priceBid;
	}

	public String getProjName() {
		return projName;
	}

	public void setProjName(String projName) {
		this.projName = projName;
	}

	public int getProbability() {
		return probability;
	}

	public void setProbability(int probability) {
		this.probability = probability;
	}

	public String getOppName() {
		return oppName;
	}

	public void setOppName(String oppName) {
		this.oppName = oppName;
	}

	public String getExeName() {
		return exeName;
	}

	public void setExeName(String exeName) {
		this.exeName = exeName;
	}

	public String getCurrncy() {
		return currncy;
	}

	public void setCurrncy(String currncy) {
		this.currncy = currncy;
	}

	public Date getCurrDate() {
		return currDate;
	}

	public void setCurrDate(Date currDate) {
		this.currDate = currDate;
	}

	public String getEnqNum() {
		return enqNum;
	}

	public void setEnqNum(String enqNum) {
		this.enqNum = enqNum;
	}
	public DailyActivity getDactid() {
		return dactid;
	}
	public void setDactid(DailyActivity dactid) {
		this.dactid = dactid;
	}
	
	

}
